<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta id="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="apple-themes-web-app-capable" content="yes">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no">
		<title>登录</title>
		<link rel="stylesheet" href="${s.base}/mobile/css/main.css" type="text/css" media="all">
	</head>

	<body> 
		<header id="header">
			<div class="header_con">
                <div class="top_tit">登录</div>         
			</div>
		</header>
		<input type="hidden" value="${memberId}" id="memberId" />
		<div id="content_div">
             <div class="pay_02">
              <p class="border_bottom">登录名：<input type="text" id="phone" style="width: 80%;height: 0.8rem;line-height: 0.8rem;border: 0px; text-align: left;" placeholder="请输入注册手机号" /></p>
               <p class="border_bottom">密&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" id="password" style="width: 80%;height: 0.8rem;line-height: 0.8rem;border: 0px; text-align: left;" placeholder="请输入密码" /></p>
             </div>
             
              <div class="pay_04 margin_top_1"><a class="ui-btn" href="javascript:void(0)" id="login">立即登录</a></div>
              <div class="pay_04">
              	<div style="width:50%; float:left; color:#000; text-align:center;" id="reg">立即注册</div>
                <div style="width:50%; float:left; color:#000; text-align:center;" id="forgetPassword">忘记密码</div>
              </div>
      </div>
		<script src="${s.base}/mobile/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>
		<script type="text/javascript" src="${s.base}/js/layer/layer.js"></script>
		<script type="text/javascript" src="${s.base}/js/base/commont.js"></script>
      <script>
		  $("#reg").click(function () {
			  window.location.href = "/phone/registePage?memberId="+$("#memberId").val();
          });
          $("#forgetPassword").click(function () {
              window.location.href = "/phone/forgetPwsPage?memberId="+$("#memberId").val();
          });

		$("#login").click(function(){
		    var phone = $("#phone").val();
		    var password = $("#password").val();
		    if (phone == null || phone == ""){
                layer.alert("您必须输入注册手机号");
                return false;
			}
			if (password == null || password == ""){
                layer.alert("您必须输入登录密码");
                return false;
			}
            $.post("/phone/login",{
                phone : phone,
				id:$("#memberId").val(),
                password : password
            },function(result){
                if(result.code=="success"){
					var memberInfo = result.result;
                    // 保存cookie至当前
                    setCookie('memberId',memberInfo.id,7);
                    //showLayerAlertNoReload("操作成功！");
                    location.href=result.url+"?memberId="+memberInfo.id;
                }else{
                    showLayerAlertNoReload(result.errorMsg);
                }
            },"json");
            return false;
		});
	  </script>

	</body>
</html>